# delimit ;
set more off ;
capture log close ;
clear all ;

/* MASTER FILE FOR EPA WQ GRANT FINAL SP SURVEY DATA PROCESSING AND ANALYSIS */
/* AUTHOR: ROGER H. VON HAEFEN  */
/* LAST EDITED: JANUARY 1, 2022 */



global impute_log       = "log\1-impute.log" ;                  /* IMPUTE LOG FILE */
global weights_log      = "log\2-weights.log" ;                 /* SAMPLING WEIGHTS LOG FILE */
global ee_analysis_log  = "log\3-ee_data_analysis.log" ;        /* EXPERT ELICITATION ANALYSIS LOG FILE */
global ce_analysis_log  = "log\4-ce_data_analysis.log" ;        /* CHOICE EXPERIMENT ANALYSIS LOG FILE */
global sensitivities_log= "log\5-sensitivities.log" ;           /* ABSELINE MODEL AND SENSITIVITIES */
global case_study_log   = "log\6-case_study.log" ;              /* CASE STUDY LOG FILE */

global survey_data      = "data\streams_sp_data_final" ;        /* SURVEY DATA FOR ALL THREE COUNTIES */
global imputed_data     = "data\imputed_data" ;                 /* SURVEY DATA W/ MISSING VALUES IMPUTED */
global invited_sample   = "data\invited_sample" ;               /* 6-DIGIT CODES FOR 12,500 RESIDENTS INVITED TO PARTICIPATE IN SURVEY */
global returned_mail    = "data\returned_mail.xlsx" ;           /* SURVEY CODES FOR RETURNED/UNDELIVERED MAILINGS */
global weights_data     = "data\weights_final" ;                /* SAMPLING WEIGHTS FILE */
global ce_data  	= "data\ce_data" ;       	        /* CE DATA REFORMATTED FOR STATA ESTIMATION */
global ee_data          = "data\ee_data" ;                      /* EE DATA */
global scenarios_data   = "data\case_study_scenarios.xlsx" ;    /* WATER QUALITY POLICY SIMULATION FOR UPPER NUESE */

do do\1-impute ;      						/* IMPUTING MISSING DATA */
do do\2-weights ;       					/* CONSTRUCTING WEIGHTS */
do do\3-ee_data_analysis ;					/* EE ANALYSIS */
do do\4-ce_data_analysis ;      				/* CE ANALYSIS & EXPORT DATA TO TEXT FILES */
do do\5-sensitivities ;						/* SENSITIVITIES */
do do\6-case_study ;						/* CASE STUDY */
